import React, { useState } from "react";
import classNames from "classnames";
import "./index.less";
import {NavBar,Switch} from '@/ui'
export default function Home(props: any) {
  const { prefixCls = "m-react-pages-switch" } = props;
  const className = classNames({
    [prefixCls]: true,
  });
  const [checked, setChecked] = useState(true);
  const onChangeAction = (checked) => {
    setChecked(checked);
  };
  return (
    <div className={className}>
      <NavBar title="Switch" />
      <div className="list">
        <Switch checked={checked} color="#e1251b" onClick={onChangeAction} />
      </div>
      <div className="list">
        <Switch checked={checked} color="#e1251b" onClick={onChangeAction} />
      </div>
      <div className="list">
        <Switch checked={checked} color="#eee" onClick={onChangeAction} disabled />
      </div>
      <div className="list">
        <Switch
          checked={checked}
          color="#e1251b"
          onClick={onChangeAction}
          platform="android"
        />
      </div>
      <div className="list">
        <Switch
          checked={checked}
          color="#e1251b"
          onClick={onChangeAction}
          platform="android"
        />
      </div>
    </div>
  );
}
